package com.bbs.pojo.dto;

import com.bbs.pojo.User;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 无密码字段的用户传输对象
 */
@Data
@NoArgsConstructor
public class UserDto {
    private String userId;

    /**
     * 用户名
     */
    private String username;

    /**
     * 用户角色
     */
    private String role;

    /**
     * 性别
     */
    private Boolean sex;

    /**
     * 经验
     */
    private Integer experience;

    public UserDto(User user) {
        this.userId = user.getUserId();
        this.username = user.getUsername();
        this.role = user.getRole();
        this.experience = user.getExperience();
        this.sex = user.getSex();
    }
}
